/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bitoon.basketdudes.jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "acumuladowbc", schema = "rankings")
@NamedQueries({
//    @NamedQuery(name = "Acumulado.findByRangoPosicion",query = "select p from Acumulado p where p.posicion>=:min_pos and p.posicion<=:max_pos order by p.posicion desc"),
//    @NamedQuery(name = "Acumulado.findByPosicion",     query = "SELECT r FROM Acumulado r WHERE r.posicion = :posicion"),
    @NamedQuery(name = "Acumuladowbc.findByEquipoId",           query = "SELECT r FROM Acumuladowbc r WHERE r.equipoId = :equipo_id order by r.categoria desc")
})
public class Acumuladowbc implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @SequenceGenerator(name="acumuladowbc_id_generator", sequenceName="rankings.acumuladowbc_id_seq", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="acumuladowbc_id_generator")
    @Basic(optional=false)
    @Column(name = "id")
    private Integer id = 0;
    
    @Basic(optional = false)
    @Column(name = "equipo_id")
    private Integer equipoId;
    @Basic(optional = false)
    @Column(name = "zona_id")
    private int zona_id = 0;
    @Column(name = "categoria")
    private int categoria = 0;
    
    
    @Basic(optional = false)
    @Column(name = "s1")
    private int s1 = 0;
    @Basic(optional = false)
    @Column(name = "s2")
    private int s2 = 0;
    @Basic(optional = false)
    @Column(name = "s3")
    private int s3 = 0;
    @Basic(optional = false)
    @Column(name = "s4")
    private int s4 = 0;
    @Basic(optional = false)
    @Column(name = "s5")
    private int s5 = 0;
    @Basic(optional = false)
    @Column(name = "s6")
    private int s6 = 0;
    @Basic(optional = false)
    @Column(name = "s7")
    private int s7 = 0;

    @Basic(optional = false)
    @Column(name = "jugados")
    private int jugados = 0;
    
    @Basic(optional = true)
    @Column(name = "f_ultimo")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fUltimo;
    
    public Acumuladowbc() {
    }

    public Acumuladowbc(Integer id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getEquipoId() {
        return equipoId;
    }

    public void setEquipoId(int valor) {
        this.equipoId = valor;
    }
    
    public int getS1() {
        return s1;
    }

    public void setS1(int valor) {
        this.s1 = valor;
    }

    public int getS2() {
        return s2;
    }

    public void setS2(int valor) {
        this.s2 = valor;
    }

    public int getS3() {
        return s3;
    }

    public void setS3(int valor) {
        this.s3 = valor;
    }

    public int getS4() {
        return s4;
    }

    public void setS4(int valor) {
        this.s4 = valor;
    }

    public int getS5() {
        return s5;
    }

    public void setS5(int valor) {
        this.s5 = valor;
    }

    public int getS6() {
        return s6;
    }

    public void setS6(int valor) {
        this.s6 = valor;
    }

    public int getS7() {
        return s7;
    }

    public void setS7(int valor) {
        this.s7 = valor;
    }

    public int getJugados() {
        return jugados;
    }

    public void setJugados(int valor) {
        this.jugados = valor;
    }
    
    public int getZonaId() {
        return zona_id;
    }

    public void setZonaId(int valor) {
        this.zona_id = valor;
    }

    public int getCategoria() {
        return this.categoria;
    }

    public void setCategoria(int valor) {
        this.categoria = valor;
    }

    public Date getfUltimo() {
        return fUltimo;
    }

    public void setfUltimo(Date fUltimo) {
        this.fUltimo = fUltimo;
    }   
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Acumuladowbc)) {
            return false;
        }
        Acumuladowbc other = (Acumuladowbc) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.basketdudes.jpa.Acumuladowbc[id=" + id + "]";
    }

}
